WIP: adds option to partition from an existing binary coloring file#117
Open
ecoon wants to merge 4 commits intoMeshToolkit:masterfrom
Open
WIP: adds option to partition from an existing binary coloring file#117ecoon wants to merge 4 commits intoMeshToolkit:masterfrom
ecoon wants to merge 4 commits intoMeshToolkit:masterfrom
Conversation
Collaborator
Author
|
@raovgarimella Any thoughts on this? I'm going to add it as a patch in Amanzi for now as I need it now, but it would be nice to get this included at some point. |
Contributor
|
Sounds good. It's a good idea for MSTK as well. Perhaps a trivial student project? |
Collaborator
Author
|
This is a pull request -- it's implemented here. |
raovgarimella
approved these changes
Sep 14, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@raovgarimella I'd like to add a capability to partition based on a user-provided file. The attached pull request works in the one simple file example I've tried. It is a bit weird because there is no way of providing MESH_Get_Partition with a filename option, so currently the filename is hard-coded as "./coloring.bin".
The file format is simply a bunch of ints, one per region, defining the color (from 0 to NPROC).
The implementation simply mallocs parts, then reads it from file in a single block. To write this file, one must write a C binary file, which can be done in C or in python, e.g. for a four-cell problem:
At first glance this worked for me, and allowed meshconvert to partition this file as requested (using partition-method=3).